package com.henu.rescue.service.impl;

import com.henu.rescue.entity.Evaluate;
import com.henu.rescue.entity.StandardType;
import com.henu.rescue.entity.VO.EvaluateVO;
import com.henu.rescue.entity.VO.OrderVO;
import com.henu.rescue.entity.VO.StandardAverageScore;
import com.henu.rescue.entity.VO.StandardCount;
import com.henu.rescue.mapper.EvaluateMapper;
import com.henu.rescue.service.EvaluateService;
import com.henu.rescue.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class EvaluateServiceImpl implements EvaluateService {

    @Autowired
    private EvaluateMapper evaluateMapper;

    @Override
    public Integer add(Evaluate evaluate) {
        return evaluateMapper.add(evaluate);
    }

    @Override
    public Integer getStandardCount() {
        return evaluateMapper.getStandardCount();
    }

    @Override
    public List<StandardType> getStandard() {
        return evaluateMapper.getStandard();
    }

    @Override
    public List<StandardAverageScore> getStandardAverageScores() {
        return evaluateMapper.getStandardAverageScores();
    }

    @Override
    public Page<EvaluateVO> getAllEvaluateByPage(Page<EvaluateVO> page) {
        List<EvaluateVO> evaluateList = evaluateMapper.selectEvaluateInfoByPage(page);
        page.setList(evaluateList);
        //查询总数
        int totalCount =evaluateMapper.getCountByPage(page);
        page.setTotalCount(totalCount);
        return page;
    }

    @Override
    public List<StandardCount> getCount80() {
        return evaluateMapper.getCount80();
    }

    @Override
    public List<StandardCount> getCount60_80() {
        return evaluateMapper.getCount60_80();
    }

    @Override
    public List<StandardCount> getCount60() {
        return evaluateMapper.getCount60();
    }
}
